Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pass frame / stream type parsing errors to the hijacker callbacks #3429

Merged
merged 2 commits into from
May 27, 2022

Conversation

marten-seemann
Copy link
Member

When a stream is reset, we might not have received the frame / stream type yet. The callback might be able to identify if it was a stream intended for that application by analyzing the stream reset error.

This will allow us to resolve marten-seemann/go-libp2p-webtransport#3. The WebTransport implementation can determine if the stream reset error code is in the WebTransport error code range.

@ydnar @hareku Thoughts?

@codecov
Copy link

codecov bot commented May 23, 2022

Codecov Report

Merging #3429 (96c0dac) into master (3088865) will increase coverage by 0.01%.
The diff coverage is 90.91%.

@@            Coverage Diff             @@
##           master    #3429      +/-   ##
==========================================
+ Coverage   85.66%   85.67%   +0.01%     
==========================================
  Files         136      136              
  Lines        9948     9957       +9     
==========================================
+ Hits         8521     8530       +9     
- Misses       1049     1050       +1     
+ Partials      378      377       -1     
Impacted Files Coverage Δ
http3/roundtrip.go 93.55% <ø> (ø)
http3/frames.go 84.62% <71.43%> (-1.69%) ⬇️
http3/client.go 90.91% <100.00%> (+0.64%) ⬆️
http3/server.go 74.45% <100.00%> (+0.48%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3088865...96c0dac. Read the comment docs.

Copy link
Collaborator

@MarcoPolo MarcoPolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Granted, I'm not familiar with this codebase, this change seems relatively straightforward and it makes sense that a hijacker would have more context than the general library.

One question not specific to this PR but in general is that it seems like there are UniStreamHijacker tests but no matching StreamHijacker tests. Any specific reason?

@hareku
Copy link
Contributor

hareku commented May 27, 2022

One question not specific to this PR but in general is that it seems like there are UniStreamHijacker tests but no matching StreamHijacker tests. Any specific reason?

Please use #3391 if you like.

When a stream is reset, we might not have received the frame / stream
type yet. The callback might be able to identify if it was a stream
intended for that application by analyzing the stream reset error.
@marten-seemann
Copy link
Member Author

@hareku Thank you. I had actually missed your PR. I've merged it now, and rebased this PR.

@MarcoPolo Thanks for pointing this is out in the review. This actually helped uncover a bug, which I fixed in 5cb2e82.

@marten-seemann marten-seemann merged commit 708eb47 into master May 27, 2022
@marten-seemann marten-seemann deleted the stream-hijacker-errors branch May 27, 2022 20:30
@MarcoPolo MarcoPolo mentioned this pull request Jul 7, 2022
41 tasks
@ajnavarro ajnavarro mentioned this pull request Aug 24, 2022
72 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

deal with WebTransport stream cancelations at the beginning of the stream
3 participants